package com.shuyun.vertx.quickstart;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;

/**
 * Created by feng.ding on 2017/1/12.
 */
public class MyFirstVerticle extends AbstractVerticle {

    @Override
    public void start(Future<Void> startFuture) throws Exception {
        vertx.createHttpServer().requestHandler(r -> r.response().end("<h1>Hello Vertx</h1>"))
                .listen(8080, result -> {
                    if(result.succeeded()){
                        startFuture.complete();
                    }
                    startFuture.fail(startFuture.cause());
                });
    }
}
